/**
 * 
 */
package model;

import java.util.List;

import model.parser.Parser;
import model.semantics.Node;
import model.turtle.Position;
import model.turtle.Turtle;


/**
 * 
 */
public class Model {
	private static final String TOKEN_FILE = "token";
	private static final String SYNTAX_FILE = "syntax";
	private Parser<Integer> myParser;
	private TurtleState state;
	
	
	/**
	 * @return the list of turtles.
	 */
	public Model(){
		myParser = new Parser<Integer>(TOKEN_FILE, SYNTAX_FILE);
		
		state = new TurtleState();
	}
	
	public List<Turtle> execute(String command){
		Node<Integer> root = myParser.parse(command);
		root.evaluate(state);
		return state.getTurtleList();
	}
	
	public List<Turtle> getTurtles(){
		return state.getTurtleList();
	}
}
